package com.ygqh.baby.mapper;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.CommentCountModel;
import com.ygqh.baby.model.YgIndexCommentModel;
import com.ygqh.baby.model.YgPublishCommentModel;
import com.ygqh.baby.po.YgPublishComment;
import com.ygqh.baby.po.YgPublishCommentExample;

public interface YgPublishCommentMapper {
	int countByExample(YgPublishCommentExample example);

	int deleteByExample(YgPublishCommentExample example);

	int deleteByPrimaryKey(Long id);

	int insert(YgPublishComment record);

	int insertSelective(YgPublishComment record);

	List<YgPublishComment> selectByExample(YgPublishCommentExample example);

	YgPublishComment selectByPrimaryKey(Long id);

	int updateByExampleSelective(@Param("record") YgPublishComment record, @Param("example") YgPublishCommentExample example);

	int updateByExample(@Param("record") YgPublishComment record, @Param("example") YgPublishCommentExample example);

	int updateByPrimaryKeySelective(YgPublishComment record);

	int updateByPrimaryKey(YgPublishComment record);

	int countSuper(@Param("q") String q, @Param("id") Long id, @Param("checkStatus") String checkStatus, @Param("startTime") Date startTime,
			@Param("endTime") Date endTime);

	List<CommentCountModel> findCountByPublishIds(@Param("commentType") String commentType, @Param("publishIds") Long[] publishIds);

	List<YgPublishComment> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("q") String q, @Param("id") Long id,
			@Param("checkStatus") String checkStatus, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

	List<YgPublishCommentModel> findCommentByPublishId(@Param("publishId") Long publishId);

	List<YgIndexCommentModel> findCommentByPublishIds(@Param("publishIds") Long[] publishIds);

	/**
	 * 批量审核晒单评论
	 * 
	 * @param checkStatus
	 *            (Pass Reject)
	 * @param ids
	 * @return
	 */
	int updateBatchChechStatus(@Param("checkBy") String checkBy, @Param("checkStatus") String checkStatus, @Param("ids") Long[] ids);

	List<YgPublishComment> selectByPublishId(@Param("publishId") Long publishId);

}
